
<?php
//kurs/wp-content/plugins/courses/kurs_admin_panel_v8.php
function panel_htm(){
global $wpdb;
        $prefix='kuar';

$path = WP_PLUGIN_URL.'/courses/style/images/upel_img';
$pan = '';

 $pan .= '<div id="notebook">';
$pan .= '<div id="sys_menu" class="ui-widget-header" style="position:absolute;left:210px;top:4px;height:27px;width:400px;border:0;z-index:34;">';
$pan .= '<table class="tabfix" style="width:100%">
<col style="width:5%"><col style="width:40%"><col style="width:18%">
<col style="width:20%"><col style="width:17%">
<tbody>
<tr>
<td>
<span id="lku"></span>
</td>

<td class="tdmen">
 <div class="selectWrap">
<select id="sel_kur" class="conn" gen="-1" ch="-1">
<option value="-1" selected>Выберите курс</option>';

$sql = "SELECT kid,kurs_name FROM ".$prefix."_zz_kurs";

     $kurses = $wpdb->get_results($sql, ARRAY_A);

                        foreach ($kurses as $kurs) {
                          $kid = $kurs['kid'];
             $knam = $kurs['kurs_name'];
             $pan .='<option value="'.$kid.'">'.$knam.'</option>';
             }

$pan .= '</select><span class="link" style="display:block;cursor:pointer;">Курсы</span></div></td>
<td class="tdmen"></td>
<td class="tdmen"></td>
<td class="tdmen"></td>
</tr></tbody></table>';

$pan .= '</div>';





$pan .= '<div id="maintabs" style="z-index:32;">
    <ul id="mainul" style="height:27px;">
        <li><a href="#kursars"><span>Курс</span></a></li>
        <li><a href="#lesars"><span>Занятие</span></a></li>

    </ul>
    <div id="kursars">';



 $pan .= '<div id="contmen"  class="uniPanel" style="height:7px;background  :url('.WP_PLUGIN_URL.'/courses/style/images/unpanel_images/bordo/topback.gif) repeat;border:2px solid #721b1b;z-index:100;">';
 $pan .= '<div id="mainmenu" class="uniPanel" style="top:45px;width:500px;margin-left:400px;z-index:50;background:#dc6464;">

                        <div id="c_mainmenu" class="content_pan"  st="opened"
                     style="border:2px solid #721b1b;border-bottom:0;border-top:0;background:#721b1b;color:black;
                     height:40px;maxheight:250px;overflow:auto;font-size:80%;font-weight:bold;">

                     <ul id="jsddm">
      <li><a href="#">Аппликация</a>
          <ul>
              <li id="ddm_app_new"><a href="#">Новая</a></li>
              <li id="ddm_app_save"><a href="#">Сохранить</a></li>
              <li id="ddm_app_saveas"><a href="#">Сохранить как</a></li>
          </ul>
      </li>
      <li><a href="#">HTML/CSS</a>
          <ul>
              <li id="ddm_htm_new"><a href="#">Новый</a></li>
              <li id="ddm_htm_recent"><a href="#" onClick="show_modal(\'1\');">Недавние загрузки</a></li>
              <li id="ddm_htm_outside"><a href="#">Загрузить извне</a></li>
              <li id="ddm_htm_save"><a href="#"><span class="panpult" mod="7">Сохранить</span></a></li>
              <li id="ddm_htm_saveas" step="0"><a href="#"><span class="panpult" mod="0">Сохранить как</span></a></li>

          </ul>
      </li>
      <li><a href="#">Скрипт</a></li>
      <li><a href="#" onClick="show_modal(\'9\');">Каталоги</a></li>

      <li><a href="#">Help</a></li>
  </ul>
                  </div>';

//border-top:2px solid #721b1b; border-bottom:2px solid #721b1b;border-left:0;border-right:0;
    $pan .=   '<div>
                     <div id="h_mainmenu" class="unip_head uniPanel" style="background  :url('.WP_PLUGIN_URL.'/courses/style/images/unpanel_images/bordo/topback.gif);
                     height:7px;z-index:2000;"></div></div>
                     </div>';


  $pan .= '</div>';

$pan .= '<table style="table-layout:fixed;border:0;width:100%;">
        <col style="width:27%;"><col style="width:73%;">
        <tbody>
        <tr><td id="kursars_doleft" style="vertical-align:top;">';
$pan .= '<table style="table-layout:fixed;border:0;width:100%;"><tbody><tr><td id="lesheader" style="background:#edbd16;">';
$pan.= '<span style="display:inline;" class="upel" title="Новый урок"><a href="#"  onclick="add_lesson_branch(\'-1\',\'m-1\');"><img class="mg" src="'.$path.'/add_circ.png"></a></span>&nbsp;&nbsp;';
$pan .= '<span style="display:inline;" class="upel" title="Сохранение курса"><a href="#"  onclick="mk_string_and_save_kurs();"><img class="mg" src="'.$path.'/save.png"></a></span>&nbsp;&nbsp;';
$pan .= '<span style="display:inline;" class="upel" title="Создать маршрут"><a href="#"  onclick="make_marshrut(\'0\');"><img class="mg" src="'.$path.'/ipodnant.png"></a></span>&nbsp;&nbsp;';
$pan .= '<span style="display:inline;" class="upel" title="Пометить как измененные"><a href="#"  onclick="mk_changed(\'0\');"><img class="mg" src="'.$path.'/chang.png"></a></span>&nbsp;&nbsp;';
$pan .= '<span style="display:inline;" class="upel" title="Редактировать путь курса"><a href="#"  onclick="show_kurspath();"><img class="mg" src="'.$path.'/arrow_join.png"></a></span>&nbsp;&nbsp;';

$pan .= '</td></tr></tbody></table>';



        $pan .= '<div id="lesview" tpl="0" style="width:95%;"></div>';

       $pan .=  '</td>
        <td id="kursars_docenter" style="vertical-align:top;"><div id="kursars_workmain" style="vertical-align:top;"></div></td>';
      $pan .= '</td></tr></tbody></table></div>';



$pan .= '<div id="lesars">';
$pan .= '<table style="table-layout:fixed;border:0;width:100%;height:100%;">
              <col style="width:250px;"><col style="width:100%;"><col style="width:270px;">
              <tbody>
              <tr>
              <td id="lesars_doleft" style="vertical-align:top;">';

$pan .= '<table style="table-layout:fixed;border:0;width:100%;"><tbody><tr><td id="uprheader"  style="background:brown;"><span>';
$pan.= '<span style="display:inline;" class="upel" title="Новая страница"><a href="#"  onclick="javascript:create_new_file(\'0\',\'f\');"><img class="mg" src="'.$path.'/add_circ.png"></a></span>&nbsp;&nbsp;';
$pan .= '<span style="display:inline;" class="upel" title="Сохранение в курсе"><a href="#"  onclick="mk_string_to_lesson();"><img class="mg" src="'.$path.'/save.png"></a></span>';

$pan .= '</span></td></tr></tbody></table>';
         $pan .= '<table id="uprview" tpl="0" class="tabfix" style="width:95%;">
                   <col style="width:10%;"><col style="width:80%;"><col style="width:7%;">
                   <tbody id="tb_uprview" loaded="-1" nosav="0">
          </tbody></table>';
$pan .= '</td>
                      <td id="lesars_dodemo"  style="border:1px solid red;vertical-align:top;">';

 $pan .= '<iframe id="showbox" width="100%" height="600" border="1" src=""></iframe>';                     


 $pan .= '</td><td style="vertical-align:top;">';

$pan .= '<table style="table-layout:fixed;border:0;width:100%;"><tbody><tr><td id="uprheader_12"><span>';
$pan .= '<span style="display:inline;" class="upel" title="Создать пустой файл"><a href="#"  onclick="create_new_file(\'-1\',\'0\');"><img class="mg" src="'.$path.'/new_file.png"></a></span>';
//$pan .= '<span style="display:inline;" class="upel" title="Внести файл"><a href="#"  onclick="insert_new_file(\'0\');"><img class="mg" src="'.$path.'/add_circ.png"></a></span>';
//$pan .= '<span style="display:inline;" class="upel" title="Список файлов курса"><a id="akurfil" href="#"  onclick="kurs_files();"><img class="mg" src="'.$path.'/file_htm.png"></a></span>';
$pan .= '<span style="display:inline;" class="upel" title="Проверить и внести невнесенные"><a id="chekinsfil" href="#"  onclick="check_insert_files(\'\');"><img class="mg" src="'.$path.'/file_add.png"></a></span>';
$pan .= '<span style="display:inline;" class="upel" title="Просмотр директорий"><a id="adirfil" href="#"  onclick="show_dirs(\'?aj=1&plg=cour&op=sdir\');"><img class="mg" src="'.$path.'/bonsai.png"></a></span>';
$pan .= '</span></td></tr>';
$pan .= '<tr><td><div id="kurdirsdiv"><span id="kdsp"></span><select id="kurdirs"  class="krdrs" style="width:170px;"></select>&nbsp;&nbsp;<button onclick="load_dirs();">Load</button></div></td>';
$pan .= '<tr><td><div id="showdiv" style="height:450px;overflow:auto;"></div></td>';

$pan .= '</tr></tbody></table>';

$pan .= '</td></tr></tbody></table>';


$pan .= '</div>';
$pan .= '<div id="zanars">';

$pan .= '</div>';
$pan .= '</div>';
$pan .= '<div id="boxes"><div id="modial" class="window"></div>';


$pan .= '<div id="mask"></div></div>';

$pan .= '<div id="toolbox" style="position:absolute;background-color:black;left:0;top:0;width:104px;height:20px;display:none;z-index:2000;">'
               .'</div>';

$pan .= '<div id="dialwin" style="position:absolute;background-color:purple;left:0;top:0;width:100px;height:100px;display:none;z-index:2000;"></div>';




    return $pan;
}
